package com.jwork.progress.controllers;

import com.jwork.progress.params.CommonResponse;
import com.jwork.progress.service.AsyncTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "异步处理")
@RestController
@RequestMapping(value = "/api")
public class AsyncTaskController {
    @Autowired
    private AsyncTaskService asyncTaskService;

    @ApiOperation(value = "测试")
    @GetMapping("/asyncTest")
    public CommonResponse getRequest() throws InterruptedException {
        CommonResponse taskWork = asyncTaskService.getTaskWork();
        return taskWork;
    }
}
